import { combineReducers } from "redux";
import Immutable from 'seamless-immutable';

function $index(state = Immutable({
    name: 'React'
}), action) {
    switch (action.type) {
  
        case 'CHANGE':
            return Immutable.setIn(
                state, 
                ['name'],
                action.change
            )
        case 'SET_MENU':
            return state.merge({
                menu: action.menu
            })
        default:
            return state
    }
}

function $global(state = {}, action) {
    switch (action.type) {
        case '':
            return
        default:
            return state
    }
}

export default combineReducers({
    $index,
    $global
})
